
package com.wzn.service;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Service
@Transactional
public class Main {
    public static void main(final String[] args) {

        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:mybatisContext.xml");

        System.out.println("[Monitor] [INFO] applicationContext:{}"+applicationContext);


        OrderService orderService = applicationContext.getBean(OrderService.class);

        System.out.println("[Monitor] [INFO] orderService:{}"+orderService);
        System.out.println("------------------");
        orderService.selectAllFromDS0();

        //orderService.clear();
        //orderService.fooService();
        //orderService.select();

//        //[order_id: 1, user_id: 10, status: UPDATED, order_id: 1, user_id: 11, status: UPDATED]
//        orderService.clear();
//        try {
//            orderService.fooServiceWithFailure();
//        } catch (final IllegalArgumentException e) {
//            System.out.println("roll back");
//        }
//        orderService.select();
    }
}
